/*
 ============================================================================
 文件名     : GameAudioPlayer.h
 描述      : 声明音频播放器类
 ============================================================================
 */

#ifndef GAME_AUDIO_PLAYER_H_
#define GAME_AUDIO_PLAYER_H_

// 引用
#include <mdaAudioSamplePlayer.h>
#include "GameObserver.h"
// 类声明
/*
 * CGameAudioPlayer类
 */
class CGameAudioPlayer : public CBase, 
                         public MMdaAudioPlayerCallback,
                         public MGameObserver
	{
public:
	static CGameAudioPlayer* NewL();
	~CGameAudioPlayer();

public:
	void MapcInitComplete(TInt aError, 
			const TTimeIntervalMicroSeconds& aDuration);
	void MapcPlayComplete(TInt aError);
	
public:
	void Play();
	
public: // from MGameObserver
    void GameChanged( CEngine* aGame );
    void GameOver( CEngine* aGame );
    void GamePaused( CEngine* aGame );
    void BallHitsLine( CEngine* aGame );
	
private:
    CGameAudioPlayer();
	void ConstructL();

private:
	CMdaAudioPlayerUtility* iPlayer;
	TInt iState;
	
	enum SState
		{
		ENotReady,
		EReady,
		EPlaying
		};
	};

#endif /*GAME_AUDIO_PLAYER_H_*/
